from django.urls import path,re_path,include
from . import views
from rest_framework.routers import SimpleRouter

router = SimpleRouter()
router.register('category', views.CategoryView, 'category') #使用方式/goods/category/get_list/?category=1
router.register('upload', views.UploadView, 'upload') #使用方式 /goods/upload/pub/
router.register('search', views.GoodsSearchView, 'search') #使用方式：goods/search/?search=自行车
router.register('', views.GoodsListView, 'goods')

urlpatterns = [
    path('', include(router.urls)),
    re_path('list', views.PersonGoodsView.as_view()), #list 不不要加/
    re_path('persongoods/(?P<pk>\d+)', views.GoodsDetailView.as_view()), #使用goods/persongoods/1
]
